

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>cup.net.async package &mdash; cup 1.7.0 documentation</title>
  

  
  
  
  

  

  
  
    

  

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex/" />
    <link rel="search" title="Search" href="../search/" />
    <link rel="next" title="cup.res package" href="../cup.res/" />
    <link rel="prev" title="cup.net package" href="../cup.net/" /> 

  
  <script src="../_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="../" class="icon icon-home"> cup
          

          
          </a>

          
            
            
              <div class="version">
                1.7
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../cup/">cup package</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../cup/#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../cup.net/">cup.net package</a><ul class="current">
<li class="toctree-l4 current"><a class="reference internal" href="../cup.net/#subpackages">Subpackages</a></li>
<li class="toctree-l4"><a class="reference internal" href="../cup.net/#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="../cup.net/#module-cup.net.route">cup.net.route module</a></li>
<li class="toctree-l4"><a class="reference internal" href="../cup.net/#module-cup.net">Module contents</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../cup.res/">cup.res package</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cup.util/">cup.util package</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cup.services/">cup.services package</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cup.shell/">cup.shell package</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cup.storage/">cup.storage package</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cup.jenkinslib/">cup.jenkinslib package</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cup.web/">cup.web package</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.cache">cup.cache module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.const">cup.const module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.decorators">cup.decorators module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.err">cup.err module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.exfile">cup.exfile module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.flag">cup.flag module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.log">cup.log module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.mail">cup.mail module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.platforms">cup.platforms module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.thread">cup.thread module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.timeplus">cup.timeplus module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.unittest">cup.unittest module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup.version">cup.version module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cup/#module-cup">Module contents</a></li>
</ul>
</li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../">cup</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../">Docs</a> &raquo;</li>
        
          <li><a href="../cup/">cup package</a> &raquo;</li>
        
          <li><a href="../cup.net/">cup.net package</a> &raquo;</li>
        
      <li>cup.net.async package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/cup.net.async.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="cup-net-async-package">
<h1>cup.net.async package<a class="headerlink" href="#cup-net-async-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-cup.net.async.common">
<span id="cup-net-async-common-module"></span><h2>cup.net.async.common module<a class="headerlink" href="#module-cup.net.async.common" title="Permalink to this headline">¶</a></h2>
<p>common function module for cup.net.async</p>
<dl class="function">
<dt id="cup.net.async.common.ip_port2connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">ip_port2connaddr</code><span class="sig-paren">(</span><em>peer</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#ip_port2connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.ip_port2connaddr" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>connaddr is a 64bit int</dt>
<dd>32 -  16    - 16   - 32
ip - port   - stub - future</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>peer</strong> – (ipaddr, port)</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">return a connaddr</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.common.add_stub2connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">add_stub2connaddr</code><span class="sig-paren">(</span><em>pack</em>, <em>stub</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#add_stub2connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.add_stub2connaddr" title="Permalink to this definition">¶</a></dt>
<dd><p>add stub into connaddr</p>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.common.add_future2connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">add_future2connaddr</code><span class="sig-paren">(</span><em>pack</em>, <em>future</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#add_future2connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.add_future2connaddr" title="Permalink to this definition">¶</a></dt>
<dd><p>add future into connaddr</p>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.common.get_ip_and_port_connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">get_ip_and_port_connaddr</code><span class="sig-paren">(</span><em>pack</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#get_ip_and_port_connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.get_ip_and_port_connaddr" title="Permalink to this definition">¶</a></dt>
<dd><p>get (ip, port) from connaddr</p>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.common.getip_connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">getip_connaddr</code><span class="sig-paren">(</span><em>pack</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#getip_connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.getip_connaddr" title="Permalink to this definition">¶</a></dt>
<dd><p>get ip from connaddr</p>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.common.getport_connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">getport_connaddr</code><span class="sig-paren">(</span><em>pack</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#getport_connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.getport_connaddr" title="Permalink to this definition">¶</a></dt>
<dd><p>get port from connaddr</p>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.common.getstub_connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">getstub_connaddr</code><span class="sig-paren">(</span><em>pack</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#getstub_connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.getstub_connaddr" title="Permalink to this definition">¶</a></dt>
<dd><p>get stub from connaddr</p>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.common.getfuture_connaddr">
<code class="descclassname">cup.net.async.common.</code><code class="descname">getfuture_connaddr</code><span class="sig-paren">(</span><em>pack</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/common/#getfuture_connaddr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.common.getfuture_connaddr" title="Permalink to this definition">¶</a></dt>
<dd><p>get future from conaddr</p>
</dd></dl>

</div>
<div class="section" id="module-cup.net.async.conn">
<span id="cup-net-async-conn-module"></span><h2>cup.net.async.conn module<a class="headerlink" href="#module-cup.net.async.conn" title="Permalink to this headline">¶</a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">descrition:</th><td class="field-body"><p class="first">connection related module</p>
<ol class="arabic simple">
<li>There’s only 1 thread reading/receiving data from the interface.</li>
<li>There might have more than 1 thred writing data into the network
queue. 1 thread per context(ip, port).</li>
</ol>
<p class="last">Notice that _do_write will only TRY to send out some data. It might
encounter TCP/IP stack full of data in the SEND buffer-queue of
the network interface</p>
</td>
</tr>
</tbody>
</table>
<dl class="class">
<dt id="cup.net.async.conn.CConnectionManager">
<em class="property">class </em><code class="descclassname">cup.net.async.conn.</code><code class="descname">CConnectionManager</code><span class="sig-paren">(</span><em>ip</em>, <em>bindport</em>, <em>thdpool_param</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>connaddr. Convert ip:port  into a 64-bit hex.</p>
<dl class="attribute">
<dt id="cup.net.async.conn.CConnectionManager.NET_RW_SIZE">
<code class="descname">NET_RW_SIZE</code><em class="property"> = 131072</em><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.NET_RW_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="exception">
<dt id="cup.net.async.conn.CConnectionManager.QueueError">
<em class="property">exception </em><code class="descname">QueueError</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.QueueError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.QueueError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">exceptions.Exception</span></code></p>
<p>internal queue error for CConnectionManager class</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.add_write_job">
<code class="descname">add_write_job</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.add_write_job"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.add_write_job" title="Permalink to this definition">¶</a></dt>
<dd><p>add network write into queue</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.bind">
<code class="descname">bind</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.bind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.bind" title="Permalink to this definition">¶</a></dt>
<dd><p>bind the ip:port</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.cleanup_error_context">
<code class="descname">cleanup_error_context</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.cleanup_error_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.cleanup_error_context" title="Permalink to this definition">¶</a></dt>
<dd><p>clean up error context</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.close_socket">
<code class="descname">close_socket</code><span class="sig-paren">(</span><em>msg</em>, <em>recv_socket</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.close_socket"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.close_socket" title="Permalink to this definition">¶</a></dt>
<dd><p>close socket by msg</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><em>peer</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.connect" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>peer</strong> – ip:port</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.do_check_msg_ack_loop">
<code class="descname">do_check_msg_ack_loop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.do_check_msg_ack_loop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.do_check_msg_ack_loop" title="Permalink to this definition">¶</a></dt>
<dd><p>check msg ack loop</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.dump_stats">
<code class="descname">dump_stats</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.dump_stats"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.dump_stats" title="Permalink to this definition">¶</a></dt>
<dd><p>dump stats</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.get_needack_dict">
<code class="descname">get_needack_dict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.get_needack_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.get_needack_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>get neekack dict</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.get_recv_msg">
<code class="descname">get_recv_msg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.get_recv_msg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.get_recv_msg" title="Permalink to this definition">¶</a></dt>
<dd><p>get recv msg from queue</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.get_recv_msg_ind">
<code class="descname">get_recv_msg_ind</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.get_recv_msg_ind"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.get_recv_msg_ind" title="Permalink to this definition">¶</a></dt>
<dd><p>get recv msg ind</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.get_recv_queue">
<code class="descname">get_recv_queue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.get_recv_queue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.get_recv_queue" title="Permalink to this definition">¶</a></dt>
<dd><p>get recving_msg queue</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.poll">
<code class="descname">poll</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.poll"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.poll" title="Permalink to this definition">¶</a></dt>
<dd><p>start to poll</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.push_msg2needack_queue">
<code class="descname">push_msg2needack_queue</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.push_msg2needack_queue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.push_msg2needack_queue" title="Permalink to this definition">¶</a></dt>
<dd><p>get neekack dict</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.push_msg2sendqueue">
<code class="descname">push_msg2sendqueue</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.push_msg2sendqueue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.push_msg2sendqueue" title="Permalink to this definition">¶</a></dt>
<dd><p>push msg into the send queue</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.read">
<code class="descname">read</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.read" title="Permalink to this definition">¶</a></dt>
<dd><p>read with conn context</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.conn.CConnectionManager.stop">
<code class="descname">stop</code><span class="sig-paren">(</span><em>force_stop=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/conn/#CConnectionManager.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.conn.CConnectionManager.stop" title="Permalink to this definition">¶</a></dt>
<dd><p>stop the connection manager</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-cup.net.async.context">
<span id="cup-net-async-context-module"></span><h2>cup.net.async.context module<a class="headerlink" href="#module-cup.net.async.context" title="Permalink to this headline">¶</a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">description:</th><td class="field-body">Connection Context for each socket</td>
</tr>
</tbody>
</table>
<dl class="class">
<dt id="cup.net.async.context.CConnContext">
<em class="property">class </em><code class="descclassname">cup.net.async.context.</code><code class="descname">CConnContext</code><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>connection context for each socket</p>
<dl class="attribute">
<dt id="cup.net.async.context.CConnContext.CONTEXT_QUEUE_SIZE">
<code class="descname">CONTEXT_QUEUE_SIZE</code><em class="property"> = 200</em><a class="headerlink" href="#cup.net.async.context.CConnContext.CONTEXT_QUEUE_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.do_recv_data">
<code class="descname">do_recv_data</code><span class="sig-paren">(</span><em>data</em>, <em>data_len</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.do_recv_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.do_recv_data" title="Permalink to this definition">¶</a></dt>
<dd><p>push data into the recving_msg queue
network read should be in 1 thread only.</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.get_context_info">
<code class="descname">get_context_info</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.get_context_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.get_context_info" title="Permalink to this definition">¶</a></dt>
<dd><p>get context info</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.get_peerinfo">
<code class="descname">get_peerinfo</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.get_peerinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.get_peerinfo" title="Permalink to this definition">¶</a></dt>
<dd><p>get peerinfo</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.get_sending_queue">
<code class="descname">get_sending_queue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.get_sending_queue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.get_sending_queue" title="Permalink to this definition">¶</a></dt>
<dd><p>return sending queue</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.get_sock">
<code class="descname">get_sock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.get_sock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.get_sock" title="Permalink to this definition">¶</a></dt>
<dd><p>return associated socket</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.is_detroying">
<code class="descname">is_detroying</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.is_detroying"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.is_detroying" title="Permalink to this definition">¶</a></dt>
<dd><p>is context being destroyed</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.is_reading">
<code class="descname">is_reading</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.is_reading"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.is_reading" title="Permalink to this definition">¶</a></dt>
<dd><p>get if it is reading</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.move2recving_msg">
<code class="descname">move2recving_msg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.move2recving_msg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.move2recving_msg" title="Permalink to this definition">¶</a></dt>
<dd><p>get the net msg being received</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.put_msg">
<code class="descname">put_msg</code><span class="sig-paren">(</span><em>flag</em>, <em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.put_msg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.put_msg" title="Permalink to this definition">¶</a></dt>
<dd><p>Put msg into the sending queue.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>flag</strong> – <p>flag determines the priority of the msg.</p>
<p>Msg with higher priority will have bigger chance to be</p>
<p>sent out soon.</p>
</li>
<li><strong>return</strong> – return 0 on success
return 1 on TRY_AGAIN —- queue is full. network is too busy.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">TODO:</th><td class="field-body"><p class="first last">If the msg queue is too big, consider close the network link</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.release_readlock">
<code class="descname">release_readlock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.release_readlock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.release_readlock" title="Permalink to this definition">¶</a></dt>
<dd><p>release the readlock</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.release_writelock">
<code class="descname">release_writelock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.release_writelock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.release_writelock" title="Permalink to this definition">¶</a></dt>
<dd><p>release the writelock</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.set_conn_man">
<code class="descname">set_conn_man</code><span class="sig-paren">(</span><em>conn</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.set_conn_man"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.set_conn_man" title="Permalink to this definition">¶</a></dt>
<dd><p>set conn for context</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.set_destoryed">
<code class="descname">set_destoryed</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.set_destoryed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.set_destoryed" title="Permalink to this definition">¶</a></dt>
<dd><p>set context to destroyed status</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.set_peerinfo">
<code class="descname">set_peerinfo</code><span class="sig-paren">(</span><em>peer</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.set_peerinfo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.set_peerinfo" title="Permalink to this definition">¶</a></dt>
<dd><p>set peerinfo</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.set_reading">
<code class="descname">set_reading</code><span class="sig-paren">(</span><em>is_reading</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.set_reading"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.set_reading" title="Permalink to this definition">¶</a></dt>
<dd><p>set reading status</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.set_sock">
<code class="descname">set_sock</code><span class="sig-paren">(</span><em>sock</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.set_sock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.set_sock" title="Permalink to this definition">¶</a></dt>
<dd><p>associate socket</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.to_destroy">
<code class="descname">to_destroy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.to_destroy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.to_destroy" title="Permalink to this definition">¶</a></dt>
<dd><p>destroy context</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.try_move2next_sending_msg">
<code class="descname">try_move2next_sending_msg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.try_move2next_sending_msg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.try_move2next_sending_msg" title="Permalink to this definition">¶</a></dt>
<dd><p>move to next msg that will be sent</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.try_readlock">
<code class="descname">try_readlock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.try_readlock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.try_readlock" title="Permalink to this definition">¶</a></dt>
<dd><p>try to acquire readlock</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if succeed. False, otherwise</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.context.CConnContext.try_writelock">
<code class="descname">try_writelock</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/context/#CConnContext.try_writelock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.context.CConnContext.try_writelock" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if succeed. False, otherwise</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-cup.net.async.msg">
<span id="cup-net-async-msg-module"></span><h2>cup.net.async.msg module<a class="headerlink" href="#module-cup.net.async.msg" title="Permalink to this headline">¶</a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">description:</th><td class="field-body">netmsg related module</td>
</tr>
</tbody>
</table>
<dl class="class">
<dt id="cup.net.async.msg.CNetMsg">
<em class="property">class </em><code class="descclassname">cup.net.async.msg.</code><code class="descname">CNetMsg</code><span class="sig-paren">(</span><em>is_postmsg=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>flag: System use only.
type: System will use type &gt; 65535. Users will use type &lt;=65535</p>
<p>#head  CUP012-3 for building connection
#len - uint64
#fromip,port, stub -uint64
#toip,port, stub   -uint64
#msg_type          -uint32
#uniqid            -128bit [64bit ip, port, 64 bit, uniqid]
#body           -no limit (length:uint64)</p>
<dl class="attribute">
<dt id="cup.net.async.msg.CNetMsg.MSGTYPE">
<code class="descname">MSGTYPE</code><em class="property"> = &lt;cup.net.async.msg.CMsgType object&gt;</em><a class="headerlink" href="#cup.net.async.msg.CNetMsg.MSGTYPE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cup.net.async.msg.CNetMsg.MSG_FLAG_MAN">
<code class="descname">MSG_FLAG_MAN</code><em class="property"> = &lt;cup.net.async.msg.CMsgFlag object&gt;</em><a class="headerlink" href="#cup.net.async.msg.CNetMsg.MSG_FLAG_MAN" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="cup.net.async.msg.CNetMsg.MSG_SIGN">
<code class="descname">MSG_SIGN</code><em class="property"> = 'CUP012-3'</em><a class="headerlink" href="#cup.net.async.msg.CNetMsg.MSG_SIGN" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.add_flag">
<code class="descname">add_flag</code><span class="sig-paren">(</span><em>flag</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.add_flag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.add_flag" title="Permalink to this definition">¶</a></dt>
<dd><p>add flag into the msg</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.add_retry_times">
<code class="descname">add_retry_times</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.add_retry_times"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.add_retry_times" title="Permalink to this definition">¶</a></dt>
<dd><p>add retry times</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_body">
<code class="descname">get_body</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_body"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_body" title="Permalink to this definition">¶</a></dt>
<dd><p>get msg body</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_bodylen">
<code class="descname">get_bodylen</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_bodylen"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_bodylen" title="Permalink to this definition">¶</a></dt>
<dd><p>get body length</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_callback_function">
<code class="descname">get_callback_function</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_callback_function"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_callback_function" title="Permalink to this definition">¶</a></dt>
<dd><p>get callback function</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_errmsg">
<code class="descname">get_errmsg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_errmsg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_errmsg" title="Permalink to this definition">¶</a></dt>
<dd><p>get errmsg if we encounter errors sending it out</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_flag">
<code class="descname">get_flag</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_flag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_flag" title="Permalink to this definition">¶</a></dt>
<dd><p>get msg flag</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_from_addr">
<code class="descname">get_from_addr</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_from_addr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_from_addr" title="Permalink to this definition">¶</a></dt>
<dd><p>get from addr. ((ip, port), (stub, future))</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_last_retry_time">
<code class="descname">get_last_retry_time</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_last_retry_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_last_retry_time" title="Permalink to this definition">¶</a></dt>
<dd><p>get last_retry_time</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_msg_context">
<code class="descname">get_msg_context</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_msg_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_msg_context" title="Permalink to this definition">¶</a></dt>
<dd><p>get msg context</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_msg_len">
<code class="descname">get_msg_len</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_msg_len"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_msg_len" title="Permalink to this definition">¶</a></dt>
<dd><p>get msg len</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_msg_type">
<code class="descname">get_msg_type</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_msg_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_msg_type" title="Permalink to this definition">¶</a></dt>
<dd><p>get msg type</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_order_counts">
<code class="descname">get_order_counts</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_order_counts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_order_counts" title="Permalink to this definition">¶</a></dt>
<dd><p>get order counts</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_resend_flag">
<code class="descname">get_resend_flag</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_resend_flag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_resend_flag" title="Permalink to this definition">¶</a></dt>
<dd><p>get msg handle flag</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_retry_interval">
<code class="descname">get_retry_interval</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_retry_interval"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_retry_interval" title="Permalink to this definition">¶</a></dt>
<dd><p>get retry_interval</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_retry_times">
<code class="descname">get_retry_times</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_retry_times"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_retry_times" title="Permalink to this definition">¶</a></dt>
<dd><p>get retry times</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_to_addr">
<code class="descname">get_to_addr</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_to_addr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_to_addr" title="Permalink to this definition">¶</a></dt>
<dd><p>get to addr</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_total_timeout">
<code class="descname">get_total_timeout</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_total_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_total_timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>get total_timeout</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_uniq_id">
<code class="descname">get_uniq_id</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_uniq_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_uniq_id" title="Permalink to this definition">¶</a></dt>
<dd><p>get unique msg id</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.get_write_bytes">
<code class="descname">get_write_bytes</code><span class="sig-paren">(</span><em>length</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.get_write_bytes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.get_write_bytes" title="Permalink to this definition">¶</a></dt>
<dd><p>get write bytes from the msg</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.is_a_recvmsg">
<code class="descname">is_a_recvmsg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.is_a_recvmsg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.is_a_recvmsg" title="Permalink to this definition">¶</a></dt>
<dd><p>is a msg being received</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.is_a_sendmsg">
<code class="descname">is_a_sendmsg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.is_a_sendmsg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.is_a_sendmsg" title="Permalink to this definition">¶</a></dt>
<dd><p>is a msg being sent</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.is_msg_already_sent">
<code class="descname">is_msg_already_sent</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.is_msg_already_sent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.is_msg_already_sent" title="Permalink to this definition">¶</a></dt>
<dd><p>is msg already sent</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.is_recvmsg_complete">
<code class="descname">is_recvmsg_complete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.is_recvmsg_complete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.is_recvmsg_complete" title="Permalink to this definition">¶</a></dt>
<dd><p>is msg received already</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.is_sendmsg_complete">
<code class="descname">is_sendmsg_complete</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.is_sendmsg_complete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.is_sendmsg_complete" title="Permalink to this definition">¶</a></dt>
<dd><p>is msg sent complete</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.is_valid4send">
<code class="descname">is_valid4send</code><span class="sig-paren">(</span><em>netmsg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.is_valid4send"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.is_valid4send" title="Permalink to this definition">¶</a></dt>
<dd><p>for future use</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.pre_resend">
<code class="descname">pre_resend</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.pre_resend"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.pre_resend" title="Permalink to this definition">¶</a></dt>
<dd><p>set writeindex</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.push_data">
<code class="descname">push_data</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.push_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.push_data" title="Permalink to this definition">¶</a></dt>
<dd><p>push data into the msg. Return pushed length.</p>
<p>Return -1 if we should shutdown the socket channel.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><strong>exception</strong> – may raise IndexError when coming msg has problems.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.seek_write">
<code class="descname">seek_write</code><span class="sig-paren">(</span><em>length_ahead</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.seek_write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.seek_write" title="Permalink to this definition">¶</a></dt>
<dd><p>seek foreward by length</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_body">
<code class="descname">set_body</code><span class="sig-paren">(</span><em>body</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_body"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_body" title="Permalink to this definition">¶</a></dt>
<dd><p>set msg body</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_callback_function">
<code class="descname">set_callback_function</code><span class="sig-paren">(</span><em>function</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_callback_function"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_callback_function" title="Permalink to this definition">¶</a></dt>
<dd><p>set function</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_errmsg">
<code class="descname">set_errmsg</code><span class="sig-paren">(</span><em>errmsg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_errmsg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_errmsg" title="Permalink to this definition">¶</a></dt>
<dd><p>set errmsg when we encounter errors sending it out</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_flag">
<code class="descname">set_flag</code><span class="sig-paren">(</span><em>flag</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_flag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_flag" title="Permalink to this definition">¶</a></dt>
<dd><p>set flag for the msg</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_from_addr">
<code class="descname">set_from_addr</code><span class="sig-paren">(</span><em>ip_port</em>, <em>stub_future</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_from_addr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_from_addr" title="Permalink to this definition">¶</a></dt>
<dd><p>set msg from addr</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_last_retry_time">
<code class="descname">set_last_retry_time</code><span class="sig-paren">(</span><em>last_retry_time</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_last_retry_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_last_retry_time" title="Permalink to this definition">¶</a></dt>
<dd><p>set last_retry_time</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_msg_context">
<code class="descname">set_msg_context</code><span class="sig-paren">(</span><em>context</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_msg_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_msg_context" title="Permalink to this definition">¶</a></dt>
<dd><p>set up context for this netmsg</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_msg_type">
<code class="descname">set_msg_type</code><span class="sig-paren">(</span><em>msg_type</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_msg_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_msg_type" title="Permalink to this definition">¶</a></dt>
<dd><p>set msg type</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_need_head">
<code class="descname">set_need_head</code><span class="sig-paren">(</span><em>b_need=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_need_head"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_need_head" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Note:</th><td class="field-body">By default, the msg does not need to have a head unless
it’s the first msg that posted/received.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_resend_flag">
<code class="descname">set_resend_flag</code><span class="sig-paren">(</span><em>handle_flag</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_resend_flag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_resend_flag" title="Permalink to this definition">¶</a></dt>
<dd><p>set msg handle flag</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_retry_interval">
<code class="descname">set_retry_interval</code><span class="sig-paren">(</span><em>retry_interval</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_retry_interval"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_retry_interval" title="Permalink to this definition">¶</a></dt>
<dd><p>set retry_interval</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_retry_times">
<code class="descname">set_retry_times</code><span class="sig-paren">(</span><em>num</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_retry_times"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_retry_times" title="Permalink to this definition">¶</a></dt>
<dd><p>set msg retry times</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_to_addr">
<code class="descname">set_to_addr</code><span class="sig-paren">(</span><em>ip_port</em>, <em>stub_future</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_to_addr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_to_addr" title="Permalink to this definition">¶</a></dt>
<dd><p>set msg to addr</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_total_timeout">
<code class="descname">set_total_timeout</code><span class="sig-paren">(</span><em>total_timeout</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_total_timeout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_total_timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>set total_timeout</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msg.CNetMsg.set_uniq_id">
<code class="descname">set_uniq_id</code><span class="sig-paren">(</span><em>uniq_id</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CNetMsg.set_uniq_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CNetMsg.set_uniq_id" title="Permalink to this definition">¶</a></dt>
<dd><p>set msg unique id</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="cup.net.async.msg.CAckMsg">
<em class="property">class </em><code class="descclassname">cup.net.async.msg.</code><code class="descname">CAckMsg</code><span class="sig-paren">(</span><em>is_postmsg=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#CAckMsg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.CAckMsg" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#cup.net.async.msg.CNetMsg" title="cup.net.async.msg.CNetMsg"><code class="xref py py-class docutils literal notranslate"><span class="pre">cup.net.async.msg.CNetMsg</span></code></a></p>
<p>ack msg example</p>
</dd></dl>

<dl class="function">
<dt id="cup.net.async.msg.netmsg_tostring">
<code class="descclassname">cup.net.async.msg.</code><code class="descname">netmsg_tostring</code><span class="sig-paren">(</span><em>netmsg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msg/#netmsg_tostring"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msg.netmsg_tostring" title="Permalink to this definition">¶</a></dt>
<dd><p>get printable netmsg</p>
</dd></dl>

</div>
<div class="section" id="module-cup.net.async.msgcenter">
<span id="cup-net-async-msgcenter-module"></span><h2>cup.net.async.msgcenter module<a class="headerlink" href="#module-cup.net.async.msgcenter" title="Permalink to this headline">¶</a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">descrition:</th><td class="field-body">msg center related module</td>
</tr>
</tbody>
</table>
<dl class="class">
<dt id="cup.net.async.msgcenter.IMessageCenter">
<em class="property">class </em><code class="descclassname">cup.net.async.msgcenter.</code><code class="descname">IMessageCenter</code><span class="sig-paren">(</span><em>ip</em>, <em>port</em>, <em>thdpool_param=None</em>, <em>stat_intvl=20</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Message center class</p>
<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.close_socket">
<code class="descname">close_socket</code><span class="sig-paren">(</span><em>msg</em>, <em>recv_socket=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.close_socket"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.close_socket" title="Permalink to this definition">¶</a></dt>
<dd><p>close the socket by msg</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.default_handle">
<code class="descname">default_handle</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.default_handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.default_handle" title="Permalink to this definition">¶</a></dt>
<dd><p>default handle for msgcenter</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.dump_stat">
<code class="descname">dump_stat</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.dump_stat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.dump_stat" title="Permalink to this definition">¶</a></dt>
<dd><p>dump message center class</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.handle">
<code class="descname">handle</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.handle" title="Permalink to this definition">¶</a></dt>
<dd><p>handle function which should be implemented by
sub-class.</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.is_stopping">
<code class="descname">is_stopping</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.is_stopping"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.is_stopping" title="Permalink to this definition">¶</a></dt>
<dd><p>is msg center being stopped</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.post_msg">
<code class="descname">post_msg</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.post_msg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.post_msg" title="Permalink to this definition">¶</a></dt>
<dd><p>post a net msg</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.pre_handle">
<code class="descname">pre_handle</code><span class="sig-paren">(</span><em>msg</em>, <em>function</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.pre_handle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.pre_handle" title="Permalink to this definition">¶</a></dt>
<dd><p>pre_handle. Internal use ONLY. Do NOT call it directly.</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.run">
<code class="descname">run</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.run" title="Permalink to this definition">¶</a></dt>
<dd><p>run the msgcenter</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.setup">
<code class="descname">setup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.setup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.setup" title="Permalink to this definition">¶</a></dt>
<dd><p>setup the message center</p>
</dd></dl>

<dl class="method">
<dt id="cup.net.async.msgcenter.IMessageCenter.stop">
<code class="descname">stop</code><span class="sig-paren">(</span><em>force_stop=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/cup/net/async/msgcenter/#IMessageCenter.stop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cup.net.async.msgcenter.IMessageCenter.stop" title="Permalink to this definition">¶</a></dt>
<dd><p>stop the message center</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-cup.net.async">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-cup.net.async" title="Permalink to this headline">¶</a></h2>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">description:</th><td class="field-body"><strong>Async Module is a tcp framework for asynchrous network msg tranfering</strong></td>
</tr>
</tbody>
</table>
</div>
</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../cup.res/" class="btn btn-neutral float-right" title="cup.res package" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="../cup.net/" class="btn btn-neutral" title="cup.net package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, CUP-DEV.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../',
            VERSION:'1.7.0',
            LANGUAGE:'en',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="../_static/jquery.js"></script>
      <script type="text/javascript" src="../_static/underscore.js"></script>
      <script type="text/javascript" src="../_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  <script type="text/javascript" src="../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>